package leo.weixin.entity.menu;

import lombok.Data;

/**
 * 用于请求媒体素材按钮
 */
@Data
public class MediaButton extends AbstractButton{
    private String media_id ; //素材资源的id
    private MediaButton(String name,String media_id,String type){
        super(name);
        this.media_id = media_id;
        setType(type);
    }
    public static MediaButton createTextMediaButton(String name,String media_id){
        return new MediaButton(name,media_id,MediaButtonType.MEDIA_ID);
    }

    /**
     * 创建图文消息菜单按钮
     * @param name
     * @param media_id
     * @return
     */
    public static MediaButton createNewsMediaButton(String name,String media_id){
        return new MediaButton(name,media_id,MediaButtonType.VIEW_LIMITED);
    }
    interface MediaButtonType{
        String MEDIA_ID = "media_id";
        String VIEW_LIMITED = "view_limited";
    }


}
